function [s_out,g] = whitening_precode(s_in,h,noise,power,nr,nt)

v=noise*diag(diag(ones(nr)));
Rnn=v*v';
[V,gamma]=eig(h'*inv(Rnn)*h,'nobalance');
%phi_f=diag(diag(ones(length(h))));
%phi_g=diag(diag(ones(length(h))));
g=V'*h'*inv(Rnn);
f=V;
s_out=f*s_in;


%[v,d]=eig(h*h');
%s_out=v*s_in;







